package assignment4;

public class BoxAttribute extends Box{
	public BoxAttribute(double length, double width, double high) {
		super(length, width, high);
		V = length * high * width;
		S = length * width;
		overweight = V > 5000;
	}
	
	public boolean IsOverweight() {
		if(overweight) {
			System.out.println("箱子太重了");
		}
		return overweight;
	}
	
	public void ShowAttr() {
		System.out.println("箱子的体积为:"+V);
		System.out.println("箱子的底面积为:"+S);
	}
	private boolean overweight;
	private double V;
	private double S;
}
